package org.jeecg.modules.crm.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.crm.entity.Receipt;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: Receipt
 * @Author: jeecg-boot
 * @Date:   2025-04-22
 * @Version: V1.0
 */
public interface ReceiptMapper extends BaseMapper<Receipt> {


    /**
     * 根据类型查询已有相应类型的数量用于生成流水号
     */
    @Select("SELECT COUNT(*) AS number FROM receipt WHERE receipt_type = #{type}")
    public Integer getSerialNumber(@Param("type")String type);

}
